<?php
$aPath = Yii::app()->theme->baseUrl . '/assets/';
//$cities = [1=>'Москве', 'Санкт-Петербурге','Нижнем Новгороде','Екатеринбурге','Новосибирске', 'Казане'];
foreach (Yii::app()->params['regions'] as $region) {
    $cities[$region['regionId']] = $region['genitive'];
}
$metroStyles = [ 'bagrationovskaya', 'maryino',
    'voykovskaya', 'china-city',
    'prague', 'altufyevo',
    'novogireevo', 'teply-stan',
    'mitino',
];
?>

<dl class="<?php echo $class; ?>" id ="regionAddresses">
    <dt>Адреса ремонта в <?php echo $cities[Yii::app()->getModule('main')->userRegion['id']]; ?></dt>
    <dd>    
        <ul class="<?php echo $ul; ?>">
            <?php
            foreach ($contacts as $contact) {
                $metroCss = unserialize(CHtml::decode($contact['pageLinkedServices']));
                $metroCss = !empty($metroCss['metroCss']) ? $metroCss['metroCss'] : $metroStyles[rand(0, sizeof($metroStyles) - 1)];
                $res = unserialize(CHtml::decode($contact['pageLinkedServices']));
                $res = ($class == '' ? $res['blockTitle'] : $res['mainTitle']);
                $res = $ul == 'address-list' ? '<span>' . $res . '</span>' : $res;
                echo '<li><a class="' . $metroCss . '" href="/' . $contact['pageUrl'] . '">' . $res . '</a></li>';
            }
            ?>
        </ul>
    </dd>
</dl>